<?php
        $xcrud = Xcrud::get_instance();
        $xcrud->table('page');
          
    $xcrud->relation('category','news_category','cat_id','cat_title');
     //   $xcrud->change_type('password', 'password', 'md5');
        // hide fields
        //$xcrud->fields('avatar,ngaysinh', true);
              // hide columns
        //  $xcrud->columns('password',true);
      
      
      //------- GRIDVIEW MODE ---------
      
        //Hide field in gridview
      
              
        //Change type to remote image -------
       $xcrud->change_type('hinhanh', 'remote_image');
        
        //---------ADD /EDIT MODE----------
       
       //Display field in edit/add mode with tab
       //Hide hash and password if user not admin group in add/edit mode :
                //  $xcrud->fields('password,hash', true);
                  $xcrud->fields('tieude,hinhanh,category,gioithieu,noidung', false, 'Infor');
				
				  $xcrud->fields('seo_tieude,tags,title,keyword', false, 'Seo');
                  $xcrud->fields('home,home2,sticky', false, 'Sticky');
                
                //Pass data and don't show on form'
                  $xcrud->pass_var(array("user_add"=>$_SESSION['username'],
									  "time_show"=>date('D, d M y H:i A')
										),'create');
     
             
      
      //----------VIEW MODE-----------
      // Display field in view mode
        //          $xcrud->fields('username,email,avatar,level,danhhieu,chuky,register_day,last_login', false, 'Personal','view');
       //           $xcrud->fields('moderator,manga,mangaupload,status,ip', false, 'Private','view');
              
      
                $xcrud->label(array('tieude'=>'Tiêu Đề','seo_tieude'=>'Alias','hinhanh'=>'Hình Ảnh','gioithieu'=>'Giới  Thiệu','noidung'=>'Nội Dung','user_add'=>'User',+'time_show'=>'Time Show'));
                 $xcrud->theme('bootstrap');
                 $xcrud->table_name('Page Manage System');
				 $xcrud->no_editor('keyword,gioithieu');
  				$xcrud->show_primary_ai_column(true);
                 $xcrud->unset_csv();
                $xcrud->unset_print();
               $xcrud->button('http://gameavatar.net/p{id}/{seo_tieude}/','','icon-comment');
                  if($_SESSION['per']==2){
					   $xcrud->unset_remove();
				 }
				  if($_SESSION['per']==3){
					   exit();
				 }
                 echo $xcrud->render();
            
                //PHAI VALID LAI, CHI CO MOT VAI USER MOI CO QUYEN SUA THONG TIN CUA ADMIN GROUP VA CHINH GROUP CUA MEMBER
                //EMAIL VA  TAI KHOAN CUA USER KHONG THE THAY DOI 

?>
